import request from '@/utils/request'


// 查询供应商全部信息
export function selectSupplier() {
  return request({
    url: '/drug/supplier/selectSupplier',
    method: 'get'
  })
}



// 查询采购列表全部信息
export function selectAll(query) {
  return request({
    url: '/drug/purchase/selectAll',
    method: 'get',
    params: query
  })
}


// 查询采购单详情
export function selectParticulars(dpid) {
  return request({
    url: '/drug/purchase/selectParticulars/'+dpid,
    method: 'get',
  })
}


// 暂存或提交审核
export function suboptimal(drugList) {
  return request({
    url: '/drug/druPurchaseDrug/suboptimal',
    method: 'post',
    data: drugList
  })
}

// 修改采购订单
export function updatepurchase(data) {
  return request({
    url: '/drug/purchase/updatepurchase',
    method: 'put',
    data: data
  })
}

// 提交审核和入库
export function submitAudit(ids,state) {
  return request({
    url: '/drug/purchase/submitAudit/'+ids+"/"+state,
    method: 'post',
  })
}


// 删除订单信息
export function deletePurchase(dpids) {
  return request({
    url: '/drug/purchase/deletePurchase/'+dpids,
    method: 'delete',
  })
}
